﻿/// <reference path="../Utills.js" />
describe("TestSaveLoadOrder", function () {

    var nameConstants = {
        menuItems: "menuItems",
        order: "order",
        ordersHistoryLSKey: "ordersHistory"
    };
    
    var orderData = [{
        id: 23,
        quantity: 56,
        totalPrice: 1024,
    },
    {
        id: 29,
        quantity: 36,
        totalPrice: 1024,
    }]
    var order = {
        orderDate: Date(),
        orderData: orderData
    }
    
    beforeEach(function () {
        localStorage.clear();
    });

    it("TestSaveOrder", function () {
        server.saveOrder(order);
        var loadedOrder = server.getOrdersHistory();
        expect(JSON.stringify(loadedOrder[0]) === JSON.stringify(order)).toEqual(true);
    });
    

});